package feedback;

import org.joda.time.DateTime;

import users.Person;
import util.Entity;
import books.BookInfo;

/**
 * An user feedback. Contains a score (Rate) and a comment, given by the user.
 */
public class PersonFeedback extends Entity {

    private static final long serialVersionUID = 1L;

    private Person person;

    private FeedbackComment comment;

    private Rate rate;

    private DateTime date;

    private BookInfo book;

    public PersonFeedback() {
        super();
        // empty constructor

        this.date = DateTime.now();
    }

    public PersonFeedback(final Person aPerson, final FeedbackComment aComment, final Rate aRate,
            final BookInfo aBookInfo) {
        super();
        this.person = aPerson;
        this.comment = aComment;
        this.rate = aRate;
        this.date = DateTime.now();
        this.book = aBookInfo;
    }

    public FeedbackComment getComment() {
        return this.comment;
    }

    public void setComment(final FeedbackComment comment) {
        this.comment = comment;
    }

    public void setPerson(final Person person) {
        this.person = person;
    }

    public Rate getRate() {
        return this.rate;
    }

    public int getRateValue() {
        return this.rate.getScore();
    }

    public void setRate(final Rate rate) {
        this.rate = rate;
    }

    public Person getPerson() {
        return this.person;
    }

    public void setDate(final DateTime date) {
        this.date = date;
    }

    public DateTime getDate() {
        return this.date;
    }

    public void setBook(final BookInfo book) {
        this.book = book;
    }

    public BookInfo getBook() {
        return this.book;
    }

}
